/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package net.ubinow.mflex.exceptions;

/**
 *
 * @author Josh
 */
public class MFException extends Exception {

    public static final int ERROR_UNDEFINED = -1;
    
    protected int errorNumber = -1; 
    protected Throwable cause = null;
    protected String details = "";
    protected String errorCode = "";
    
    public MFException(){
        super();
    }
    
    public MFException( int errorNumber ){
        this( ERROR_UNDEFINED, null, "" );
    }
    
    public MFException( int errorNumber, String details ){
        this( errorNumber, null, details );
    }
    
    public MFException( int errorNumber, Throwable cause ){
        this( errorNumber, cause, cause.toString() );
    }
    
    public MFException( int errorNumber, Throwable cause, String details ){
        super( details );
        
        this.errorNumber = errorNumber;
        this.cause = cause;
        this.details = details;        
    }

    public int getErrorCode() {
        return errorNumber;
    }

    public void setErrorCode(int errorCode) {
        this.errorNumber = errorCode;
    }

    public Throwable getCause() {
        return cause;
    }

    public void setCause(Throwable cause) {
        this.cause = cause;
    }

    public String getDetails() {
        return details;
    }

    public void setDetails(String details) {
        this.details = details;
    }
    
    
    
}
